Ext.define('Admin.view.needWater.yearDispatch.YearDispatchController', {
    extend: 'Ext.app.ViewController',
    alias: 'controller.yearDispatchController',
    views: ['Admin.view.needWater.yearDispatch.YearDispatch'],
    solutionInfoWin : null,
    onBeforeSolution: function (id, action) {
        // Ext.Ajax.request({
        //     url: '/security/user/' + id,
        //     success: function () {
        //         action.resume();
        //     }
        // });
    },
    onSolution: function (id) {
    },
    onNewPlanInfoClick: function (e) {
        var x = e.getX();
        var y = e.getY();
        var iconCls = e.iconCls;
        if (iconCls.indexOf('fa-chevron-left') != -1) {
            e.setIconCls("x-fa fa-chevron-right");
            this.solutionInfoWin = Ext.create('Ext.window.Window', {
                title: '方案基本信息',
                height: 520,
                width: 280,
                resizable: false,
                closeAction: 'hide',
                //modal:true,
                layout: 'fit',
                items: {  // Let's put an empty grid in just to illustrate fit layout
                    xtype: 'solutionInfo',
                    border: false
                }
            }).showAt(x - 290, y);
        } else {
            e.setIconCls("x-fa fa-chevron-left");
            this.solutionInfoWin.close();
        }
    },
    next: function () {
        var self = this;
        self.getView().wnext();
    },
    back: function () {
        var self = this;
        self.getView().wback();
    }
})
